package com.huidu.bitrade.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.huidu.bitrade.dto.AcGroupChargeQuery;
import com.huidu.bitrade.dto.AcMemberChargeQuery;
import com.huidu.bitrade.entity.AcGroupChargeAward;
import com.huidu.bitrade.mapper.AcGroupChargeAwardMapper;
import com.huidu.bitrade.vo.AcChargeAwardRecordVo;
import com.huidu.bitrade.service.AcGroupChargeAwardService;
import com.huidu.bitrade.vo.AcGroupChargeAwardVo;
import com.huidu.bitrade.vo.MemberHdcChargeVo;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("AcGroupChargeAwardService")
@RequiredArgsConstructor
@Slf4j
public class AcGroupChargeAwardServiceImpl extends ServiceImpl<AcGroupChargeAwardMapper, AcGroupChargeAward> implements AcGroupChargeAwardService {

    private final AcGroupChargeAwardMapper acGroupChargeAwardMapper;

    /**
     * 查询每个用户每天完成交易订单手续费
     */
    @Override
    public List<MemberHdcChargeVo> getMemberChargeList(String startTime, String endTime){
       return acGroupChargeAwardMapper.getMemberChargeList(startTime,endTime);
    }

    /**
     * 查询交易手续费奖励记录
     * @param acMemberQuery
     * @return
     */
    @Override
    public IPage<AcChargeAwardRecordVo> getChargeAwardRecord(IPage page, AcMemberChargeQuery acMemberQuery){
        return page.setRecords(acGroupChargeAwardMapper.getChargeAwardRecord(page,acMemberQuery));
    }

    /**
     * 团队手续费奖励记录
     * @param acGroupChargeQuery
     * @return
     */
    @Override
    public IPage<AcGroupChargeAwardVo> getGroupChargeAward(IPage page, AcGroupChargeQuery acGroupChargeQuery){
        return page.setRecords(acGroupChargeAwardMapper.getGroupChargeAward(page,acGroupChargeQuery));
    }
}
